package com.ww.java8.fp.lambda.higher.order.func;

import java.util.function.Function;

/**
 * @author wanggw
 * @Date 2022年12月30 14:46
 */
public class ConsumerFunction {
    /**
     * 消费高阶函数
     * @param oneTwo
     * @return
     */
    static Two consume(Function<One, Two> oneTwo) {
        return oneTwo.apply(new One());
    }

    @SuppressWarnings("unused")
	public static void main(String[] args) {
        Two two = consume(one -> new Two());
    }
}

class One {}

class Two {}